<template>
  <div>
    <div class="seckillHeader">
      <p>京东秒杀</p>
      <p>14点专场</p>
      <div class="timer">
        <van-count-down :time="time">
          <template #default="timeData">
            <span class="block">{{ timeData.hours }}</span>
            <span class="colon">:</span>
            <span class="block">{{ timeData.minutes }}</span>
            <span class="colon">:</span>
            <span class="block">{{ timeData.seconds }}</span>
          </template>
        </van-count-down>
      </div>
    </div>
    <div class="seckillCenter">
      <ul>
        <li v-for="item in list" :key="item.proid">
          <img :src="item.img1" alt="" />
          <p>￥{{ item.originprice }}</p>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      time: 2 * 60 * 60 * 1000,
      count: 1,
      list: [],
    };
  },
  created() {
    this.seckillList();
  },
  methods: {
    seckillList() {
      axios.get(`/api/api/pro/seckilllist?count=${this.count}`).then((res) => {
        // console.log(res.data);
        if (res.data.code === "200") {
          this.list = res.data.data;
          // console.log(this.list);
        }
      });
    },
  },
};
</script>
<style scoped>
img {
  width: 100%;
  height: 100%;
  display: block;
}
ul,li{
  list-style: none;
}
.seckillHeader {
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.seckillHeader > p {
  font-size: 18px;
}
.seckillHeader > p:first-child {
  font-weight: bold;
  padding-left: 6px;
}
.seckillHeader > p:nth-child(2) {
  color: red;
}
.timer {
  margin-top: 16px;
}
.seckillCenter{
    margin-bottom: 20px;
}
.colon {
  display: inline-block;
  margin: 0 4px;
  color: red;
}
.block {
  display: inline-block;
  width: 22px;
  color: #fff;
  font-size: 12px;
  text-align: center;
  background-color: red;
}

ul,li{
  list-style: none;
}
ul{
  display: flex;
  flex-direction: row;
}
li > img {
  height: 26.666667vw;
}
li>p{
  color: red;
  text-align: center;
}
</style>
